address='广西'
result=f'欢迎来到{address}。'
print(result)


name='巧乐兹'
age=18
gender='男'
result=f'我的名字是{name},今年{age}岁了，我的性别是{gender}。'
print(result)

num=11
result="{:0>3d}".format(num)
print(result)

pi=3.1415
result ="{:.2f}".format(pi)
print(result)

#字符串拼接
str_one="长风破浪会有时，"
str_two="直挂云帆济沧。"
result=str_one+str_two
print(result)

#字符串替换
word ="日月之行，若出其中；星汉灿烂，若出其里；"
result_one=word.replace(";","。")
print(result_one)
result_two=word.replace(";","。", 1)
print(result_two)

#字符串分割
word="1 2 3 4 5"
result_one=word.split()
print(result_one)
word="a,b,c,d,e"
result_two=word.split(",")
print(result_two)
result_thr=word.split(",",3)
print(result_thr)

#去除字符串两侧空格

word="  来一份红豆巧乐兹  "
result=word.strip()
print(result)

#字符索引与切片
str_python ="python"
result_one =str_python[0:4]
print(result_one)
result_two=str_python[0:4:2]
print(result_two)

result_thr =str_python[3:0:-1]
print(result_thr)

result_for =str_python[-1::-2]
print(result_for)